package com.example.barcodeapp.ui.wode.activity;

import android.os.Bundle;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;

import com.example.barcodeapp.MainActivity;
import com.example.barcodeapp.R;
import com.example.barcodeapp.adapter.FragmentAdapter;
import com.example.barcodeapp.base.BaseActivity;
import com.example.barcodeapp.interfaces.IBasePersenter;
import com.example.barcodeapp.ui.home.fragment.GatherFragment;
import com.example.barcodeapp.ui.huodong.FragmentHuoDong;
import com.example.barcodeapp.ui.own.fragment.OwnFragment;
import com.example.barcodeapp.ui.wode.FragmentWoDe;
import com.example.barcodeapp.ui.wode.fragment.QuanBuFragment;
import com.google.android.material.tabs.TabLayout;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;

public class DiscountActivity extends BaseActivity {
    @BindView(R.id.iv_back_circle)
    ImageView ivBackCircle;
    @BindView(R.id.ff_back_contener)
    FrameLayout ffBackContener;
    @BindView(R.id.iv_back)
    ImageView ivBack;
    @BindView(R.id.tv_location)
    TextView tvLocation;
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.ll_to_search)
    LinearLayout llToSearch;
    @BindView(R.id.right_iv)
    ImageView rightIv;
    @BindView(R.id.right_iv_two)
    ImageView rightIvTwo;
    @BindView(R.id.tv_rught_)
    TextView tvRught;
    @BindView(R.id.tv_right_two)
    TextView tvRightTwo;
    @BindView(R.id.toolBar)
    Toolbar toolBar;
    @BindView(R.id.linearLayout9)
    LinearLayout linearLayout9;
    @BindView(R.id.tabLayout)
    TabLayout tabLayout;
    @BindView(R.id.viewPager)
    ViewPager viewPager;

    private ArrayList<Fragment> fragments;
    private FragmentAdapter fragmentAdapter;
    @Override
    protected int getLayout() {
        return R.layout.youhuijuan_activity;
    }

    @Override
    protected void initView() {
        setToolBar(true, false, true, false, false);
        setTitle("推荐", R.color.black, R.color.white);
        fragments = new ArrayList<>();
        //全部
        fragments.add(new QuanBuFragment());
        //未用过
        fragments.add(new YongGuoFragment());
        //已用过
        fragments.add(new WeiYongGuoFragment());

        fragmentAdapter = new FragmentAdapter(getSupportFragmentManager(), fragments);
        viewPager.setAdapter(fragmentAdapter);
        tabLayout.setupWithViewPager(viewPager);
        tabLayout.setTabIconTint(null);//显示图片
        tabLayout.getTabAt(0).setText("全部");
        tabLayout.getTabAt(1).setText("未用过");
        tabLayout.getTabAt(2).setText("已用过");


    }

    @Override
    protected IBasePersenter initPersenter() {
        return null;
    }

    @Override
    protected void initData() {

    }

}
